const express = require("express")

const login = express.Router() //创建路由

login.post("/", (req, res) => {  //必须要先匹配到/login ，才能来这儿
    // console.log(req.body)
    if (req.body.username == "wxj") {
        // 将用户名字信息 绑定到session上 正常应该把整个user信息绑定
        req.session.user = req.body.username
        console.log(req.body.user)
        res.json({
            message:"登录成功",
            status:"200"
        })
    }
})


module.exports = login